# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-parse-type
pkgver=0.6.0
pkgrel=3
pkgdesc="Simplifies to build parse types based on the parse module"
url="https://github.com/jenisys/parse_type"
license=('BSD')
arch=('any')
depends=('python-parse' 'python-six')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-pytest-html')
source=("https://github.com/jenisys/parse_type/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('ace12b013306d5d330ffecca2f929667169da24b6593f86c13820ff34628fb00ef045c37f5c8b6ddc1094d5a8ed6fb929918871b1d0493ef6719d2bb3d2293de')

build() {
  cd parse_type-$pkgver
  python setup.py build
}

check() {
  cd parse_type-$pkgver
  pytest
}

package() {
  cd parse_type-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
